#include<iostream>
using namespace std;
class A
{
public:
	int _a;
	A(const A& a)
	{
		_a = a._a;
		cout << "A(const A& a)" << endl;
	}
	A()
	{
		_a = 0;
		cout << "A()" << endl;
	}
	A(int value) :_a(value)//单参构造函数, ->支持隐式类型转化,也称为类型转换构造函数
	{
		cout << "A(int)" << endl;
	}
	~A()
	{
		cout << "~A()" << endl;
	}
};
int main()
{
	cout << "-----Start-----" << endl;
	A a1(1000);
	cout << "---------------" << endl;

	A a2 = 1000;//隐式类型转化 -> 单参构造函数
	cout << "---------------" << endl;

	A a3 = A(1000); //匿名函数赋值
	cout << "---------------" << endl;

	A a4 = (A)1000;//将1000强制类型转化A类型 赋值
	cout << "---------------" << endl;

	cout << "------End------" << endl;
	return 0;
}